import { View } from "@tarojs/components";
import MenuItem from "./MenuItem";
export default function Index(props) {
  const {
    data,
    addMenu,
    delMenu,
    isLink = false,
    handleLink = () => {},
    handleLink2 = () => {},
  } = props;

  return (
    <View
      style={{
        padding: "0px 10px",
        display: "flex",
        flexDirection: "column",
        gap: "10px",
      }}
    >
      {data.map((item) => (
        <MenuItem
          isLink={isLink}
          data={item}
          addMenu={(data) => {
            addMenu(data);
          }}
          delMenu={(data) => {
            delMenu(data);
          }}
          handleLink={(data) => {
            handleLink(data);
          }}
          handleLink2={(data) => {
            handleLink2(data);
          }}
        />
      ))}
    </View>
  );
}
